<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const isPregnant = false;
    const promise = new Promise((resolve, reject) => {
      if (isPregnant) {
        resolve('真');
      } else {
        reject('假')
      }
    })
    promise
      .then(name => {
        console.log(`条件为${name}`)
      })
      .catch(name => {
        console.log(`条件为${name}`)
      })
      .finally(() => {
        console.log(`判断完毕`)
      })
  </script>
</body>

</html>